package com.hjj.openJDK;

import java.util.Arrays;
import java.util.List;

public class ArrayListTest {
    public static void main(String[] args) {
        test01();
    }
    public static void test01() {
        List<Integer> list = Arrays.asList(1, 2, 3);
        Object[] array = list.toArray(); // JDK8 返回 Integer[] 数组，JDK9+ 返回 Object[] 数组
        System.out.println("array classname: " + array.getClass().getSimpleName());

        array[0] = new Object(); // JDK 1.8 中报 ArrayStoreException 异常
    }
}
